<?php

namespace App\Models;


class City extends Base
{

    /**
     * 多级联动
     * @param $pid
     * @return mixed
     */
    public static function getCityIdbypid($pid)
    {
        return self::where('pid',$pid)->select('id','name')->get();
    }

    /**
     * 获取城市名称
     * @param $id
     * @return mixed
     */
    public static function getCityName($id)
    {
        return self::where('id',$id)->value('name');
    }
}
